<?php
/*
 * Form - Kinh nghiem lam viec
 */
?>
<style>
    .modal {
        margin: -297px 0 0 -277px;
        width: 727px;
    }
    .modal-body {
        max-height: 492px;
        overflow-y: auto;
        padding: 15px;
    }
</style>
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'kinhnghiemlamviec-form',
    'type' => 'horizontal',
    'action' => Yii::app()->getBaseUrl(true) . '/ungvien/tintimviec/' . ($hid != '' && $kid != '') ? '?id=' . $hid . '&kid=' . $kid . '#step3' : '',
    'enableClientValidation' => true,
    'clientOptions' => array(
        'validateOnSubmit' => true,
    ),
    
        ));
?>
<legend class='title-field title-jobs mt_20'><i class='icon icon-plus-sign mt_5 icon-white'></i> Kinh nghiệm làm việc</legend>
<div class='info-job'>
    <?php echo $form->textFieldRow($model, 'congty', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'tinh_thanhpho', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'chucvu', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'tu', array('class' => 'span2')); ?>
    <?php echo $form->textFieldRow($model, 'den', array('class' => 'span2')); ?>

    <?php echo $form->textAreaRow($model, 'motacongviec', array('class' => 'span7 clearfix')); ?>
    <div class='control-group showsub count'>
        (Mục tiêu nghề nghiệp không được quá <input id='mtcv' value='4000' class='span1' /> kí tự)
    </div>
    <div class='div-row'>
        <label class='mt w150'>&nbsp;</label>
        <p class='nn-row'>
            <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Thêm' : 'Cập nhật', 'icon' => 'icon-refresh icon-white', 'htmlOptions' => array('id' => 'btn-action'))); ?>
            <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'reset', 'type' => 'primary', 'label' => 'Bỏ qua', 'icon' => 'icon-remove-sign icon-white', 'htmlOptions' => array('class' => 'close-form'))); ?>
        </p> 
    </div>

    <div class='clearfix'></div>
</div>
<?php $this->endWidget(); ?>

<script>
    $(document).ready(function(){
        
        function changepass(){
            bootbox.alert('submit ne');
          
        }
        
        $('.modal-footer').remove();
        
        /* mo ta kinh nghiem lam viec */
        $('#HosoKinhnghiemlamviec_motacongviec').keyup(function(){
            var mtss = $(this).val();
            if(mtss.length > 4000){
                alert('Nhập không quá 4000 từ');
                var a = mtss.substr(0,4000);
                $('#mtcv').val(a);
                return false;
            }else{
                $('#mtcv').val(4000-mtss.length);
            }
        });   
        $('#kinhnghiemlamviec-form').yiiactiveform({'validateOnSubmit':true,'attributes':[{'id':'HosoKinhnghiemlamviec_congty','inputID':'HosoKinhnghiemlamviec_congty','errorID':'HosoKinhnghiemlamviec_congty_em_','model':'HosoKinhnghiemlamviec','name':'HosoKinhnghiemlamviec[congty]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("T\u00ean c\u00f4ng ty kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>200) {
	messages.push("T\u00ean c\u00f4ng ty qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 200 k\u00ed t\u1ef1).");
}

}

}},{'id':'HosoKinhnghiemlamviec_tinh_thanhpho','inputID':'HosoKinhnghiemlamviec_tinh_thanhpho','errorID':'HosoKinhnghiemlamviec_tinh_thanhpho_em_','model':'HosoKinhnghiemlamviec','name':'HosoKinhnghiemlamviec[tinh_thanhpho]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("T\u1ec9nh \/ Th\u00e0nh ph\u1ed1 kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>100) {
	messages.push("T\u1ec9nh \/ Th\u00e0nh ph\u1ed1 qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 100 k\u00ed t\u1ef1).");
}

}

}},{'id':'HosoKinhnghiemlamviec_chucvu','inputID':'HosoKinhnghiemlamviec_chucvu','errorID':'HosoKinhnghiemlamviec_chucvu_em_','model':'HosoKinhnghiemlamviec','name':'HosoKinhnghiemlamviec[chucvu]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("Ch\u1ee9c v\u1ee5 kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>100) {
	messages.push("Ch\u1ee9c v\u1ee5 qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 100 k\u00ed t\u1ef1).");
}

}

}},{'id':'HosoKinhnghiemlamviec_tu','inputID':'HosoKinhnghiemlamviec_tu','errorID':'HosoKinhnghiemlamviec_tu_em_','model':'HosoKinhnghiemlamviec','name':'HosoKinhnghiemlamviec[tu]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("T\u1eeb kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>30) {
	messages.push("T\u1eeb qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 30 k\u00ed t\u1ef1).");
}

}

}},{'id':'HosoKinhnghiemlamviec_den','inputID':'HosoKinhnghiemlamviec_den','errorID':'HosoKinhnghiemlamviec_den_em_','model':'HosoKinhnghiemlamviec','name':'HosoKinhnghiemlamviec[den]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("\u0110\u1ebfn kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>30) {
	messages.push("\u0110\u1ebfn qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 30 k\u00ed t\u1ef1).");
}

}

}},{'id':'HosoKinhnghiemlamviec_motacongviec','inputID':'HosoKinhnghiemlamviec_motacongviec','errorID':'HosoKinhnghiemlamviec_motacongviec_em_','model':'HosoKinhnghiemlamviec','name':'HosoKinhnghiemlamviec[motacongviec]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("M\u00f4 t\u1ea3 c\u00f4ng vi\u1ec7c kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}

}}]});  
    });//end ready
</script>